﻿<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ include file="/commons/taglibs.jsp" %>
<%@taglib prefix="shiro" uri="http://shiro.apache.org/tags"%>
		<div id="navbar" class="navbar navbar-default          ace-save-state">
			<div class="navbar-container ace-save-state" id="navbar-container">
				<button type="button" class="navbar-toggle menu-toggler pull-left" id="menu-toggler" data-target="#sidebar">
					<span class="sr-only">Toggle sidebar</span>

					<span class="icon-bar"></span>

					<span class="icon-bar"></span>

					<span class="icon-bar"></span>
				</button>

				<div class="navbar-header pull-left">
					<a href="index.html" class="navbar-brand">
						<small>
							<i class="${sessionScope['SystemConfig'].systemLogo }"></i>
							<c:out value="${sessionScope['SystemConfig'].companyName }"></c:out>
						</small>
					</a>
				</div>

				<div class="navbar-buttons navbar-header pull-right" role="navigation">
					<ul class="nav ace-nav">

						<li class="light-blue dropdown-modal">
							<a data-toggle="dropdown" href="#" class="dropdown-toggle">
								<img class="nav-user-photo" src="${sessionScope['UserSessionInfo'].acctUser.logo }" />
								<span class="user-info">
									<small>Welcome,</small>
									<shiro:user>
							<shiro:principal property="name" />
						</shiro:user>
								</span>

								<i class="ace-icon fa fa-caret-down"></i>
							</a>
							<script>
								$(document).ready(function(){
									var href=window.location.href;
									
									if("${sessionScope['org.springframework.web.servlet.i18n.SessionLocaleResolver.LOCALE']}" != 'en_US')
									{
										if(href.indexOf("locale=") > 0){
											href = href.replace("locale=zh_CN","locale=en_US")
										}else if(href.indexOf("?") > 0){
											href = href + "&locale=en_US"
										}else{
											href = href + "?locale=en_US"
										}
										$("#changeLanguage").attr("href",href)
										$("#changeLanguageLabel").text('English');
									}else{
										if(href.indexOf("locale=") > 0){
											href = href.replace("locale=en_US","locale=zh_CN")
										}else if(href.indexOf("?") > 0){
											href = href + "&locale=zh_CN"
										}else{
											href = href + "?locale=zh_CN"
										}
										$("#changeLanguage").attr("href",href)
										$("#changeLanguageLabel").text('中文');
									}
								})
									
									</script>
							<ul class="user-menu dropdown-menu-right dropdown-menu dropdown-yellow dropdown-caret dropdown-close">
								<li>
									<a href="${ctx }/sysDict/list?locale=en_US" id="changeLanguage">
										<i class="ace-icon fa fa-flag"></i>
										<label id="changeLanguageLabel">English</label>
									</a>
								</li>
								

								<li>
									<a href="${ctx }/acctUser/profile">
										<i class="ace-icon fa fa-user"></i>
										Profile
									</a>
								</li>

								<li class="divider"></li>

								<li>
									<a href="${ctx }/logout">
										<i class="ace-icon fa fa-power-off"></i>
										Logout
									</a>
								</li>
							</ul>
						</li>
					</ul>
				</div>
			</div><!-- /.navbar-container -->
		</div>
